<?php

class city_m extends CI_Model {

	public function __construct() {
		parent::__construct();
		$this->load->database();
	}

	public function getItems($area = 0)
	{
		$sql = "SELECT * FROM city WHERE area = $area";
		$query = $this->db->query($sql);
		return $query->result();
	}

	public function getArea($city_id = 0)
	{
		$sql = "SELECT * FROM city WHERE id = $city_id";
		$query = $this->db->query($sql);
		return $query->row();
	}

	public function getCity()
	{
		$sql = "SELECT * FROM city";
		$query = $this->db->query($sql);
		return $query->result();
	}

}